package com.firestone.ribon.api;

import com.firestone.common.model.ServerResult;
import com.firestone.common.model.vo.BaseParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class CompanyApi {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/basic/{id}/{areaId}")
    public ServerResult<Object> basic(@PathVariable("id") String id,@PathVariable("areaId") String areaId) {
        BaseParam param = new BaseParam(id,areaId);
        return this.restTemplate.postForObject("http://company-service/company/basic", param,ServerResult.class);
    }
}